<?php
/*
 * @Author: winner
 * @Date: 2022-04-27 09:27:37
 * @LastEditTime: 2022-04-27 09:28:41
 * @LastEditors: winner
 * @Description: 
 */
namespace app\api\controller;

use app\service\MerchantService;
use app\service\OrderService;

class Merchant extends Common
{
    //通过接口获取支行信息数据
    public function BankNo()
    {
        // 是否ajax
        if (!IS_AJAX) {
            return $this->error('非法访问');
        }
        // 开始操作
        $params = $this->data_post;
        //获取银行编号
        $code_ret = MerchantService::code([
            'head_bankno' => $params['code'],
            'bank_province' => $params['province'],
            'bank_city' => $params['city']
        ]);
        if ($code_ret['returnCode'] != 'REG00000' || !is_array($code_ret['branchBankInfo'])) {
            return DataReturn('获取银行编号失败', -100);
        }
        $bank_code = $code_ret['branchBankInfo'];
        return DataReturn('sucess', 0, $bank_code);
        ///$params['bank_code'] = strval($bank_code);
    }
}
